//Thu Jun 17 15:33:17 CDT 2010
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>

using namespace std;

class ChildlessNumbers
{
public:
	int howMany(int A, int B)
	{
		int ret = 0;
		for (int i = A; i <= B; i++)
		{
			bool child = false;
			for (int j = 1; j <= 500; j++)
			{
				long long x = (long long)i * (long long) j;
				if (sum(x) == j)
				{
					child = true;
					break;
				}
			}
			if (child == false)
				ret++;
		}
		return ret;
	}
	int sum(long long N)
	{
		int sum = 0;
		while (N > 0)
		{
			sum += N % 10;
			N /= 10;
		}
		return sum;
	}
};
